3.9.58 \(\int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx\) [858]

3.9.58.1 Optimal result
3.9.58.2 Mathematica [A] (verified)
3.9.58.3 Rubi [A] (verified)
3.9.58.4 Maple [B] (verified)
3.9.58.5 Fricas [F(-1)]
3.9.58.6 Sympy [F]
3.9.58.7 Maxima [F(-2)]
3.9.58.8 Giac [F(-2)]
3.9.58.9 Mupad [F(-1)]

3.9.58.1 Optimal result

Integrand size = 29, antiderivative size = 228 \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\frac {\sqrt {c} \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{e g}+\frac {\sqrt {c d^2-b d e+a e^2} \text {arctanh}\left (\frac {b d-2 a e+(2 c d-b e) x}{2 \sqrt {c d^2-b d e+a e^2} \sqrt {a+b x+c x^2}}\right )}{e (e f-d g)}-\frac {\sqrt {c f^2-b f g+a g^2} \text {arctanh}\left (\frac {b f-2 a g+(2 c f-b g) x}{2 \sqrt {c f^2-b f g+a g^2} \sqrt {a+b x+c x^2}}\right )}{g (e f-d g)} \]

output
arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b*x+a)^(1/2))*c^(1/2)/e/g+arctanh(1/2 
*(b*d-2*a*e+(-b*e+2*c*d)*x)/(a*e^2-b*d*e+c*d^2)^(1/2)/(c*x^2+b*x+a)^(1/2)) 
*(a*e^2-b*d*e+c*d^2)^(1/2)/e/(-d*g+e*f)-arctanh(1/2*(b*f-2*a*g+(-b*g+2*c*f 
)*x)/(a*g^2-b*f*g+c*f^2)^(1/2)/(c*x^2+b*x+a)^(1/2))*(a*g^2-b*f*g+c*f^2)^(1 
/2)/g/(-d*g+e*f)
 
3.9.58.2 Mathematica [A] (verified)

Time = 0.63 (sec) , antiderivative size = 212, normalized size of antiderivative = 0.93 \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\frac {2 \sqrt {-c d^2+e (b d-a e)} g \arctan \left (\frac {\sqrt {c} (d+e x)-e \sqrt {a+x (b+c x)}}{\sqrt {-c d^2+e (b d-a e)}}\right )-2 e \sqrt {-c f^2+b f g-a g^2} \arctan \left (\frac {\sqrt {c} (f+g x)-g \sqrt {a+x (b+c x)}}{\sqrt {-c f^2+b f g-a g^2}}\right )+\sqrt {c} (-e f+d g) \log \left (e g \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )\right )}{e g (e f-d g)} \]

input
Integrate[Sqrt[a + b*x + c*x^2]/((d + e*x)*(f + g*x)),x]
 
output
(2*Sqrt[-(c*d^2) + e*(b*d - a*e)]*g*ArcTan[(Sqrt[c]*(d + e*x) - e*Sqrt[a + 
 x*(b + c*x)])/Sqrt[-(c*d^2) + e*(b*d - a*e)]] - 2*e*Sqrt[-(c*f^2) + b*f*g 
 - a*g^2]*ArcTan[(Sqrt[c]*(f + g*x) - g*Sqrt[a + x*(b + c*x)])/Sqrt[-(c*f^ 
2) + b*f*g - a*g^2]] + Sqrt[c]*(-(e*f) + d*g)*Log[e*g*(b + 2*c*x - 2*Sqrt[ 
c]*Sqrt[a + x*(b + c*x)])])/(e*g*(e*f - d*g))
 
3.9.58.3 Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.05, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {1270, 1154, 219, 1269, 1092, 219, 1154, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx\)

\(\Big \downarrow \) 1270

\(\displaystyle \frac {\left (a e^2-b d e+c d^2\right ) \int \frac {1}{(d+e x) \sqrt {c x^2+b x+a}}dx}{e (e f-d g)}-\frac {\int \frac {c d f-b e f+a e g-c (e f-d g) x}{(f+g x) \sqrt {c x^2+b x+a}}dx}{e (e f-d g)}\)

\(\Big \downarrow \) 1154

\(\displaystyle -\frac {2 \left (a e^2-b d e+c d^2\right ) \int \frac {1}{4 \left (c d^2-b e d+a e^2\right )-\frac {(b d-2 a e+(2 c d-b e) x)^2}{c x^2+b x+a}}d\left (-\frac {b d-2 a e+(2 c d-b e) x}{\sqrt {c x^2+b x+a}}\right )}{e (e f-d g)}-\frac {\int \frac {c d f-b e f+a e g-c (e f-d g) x}{(f+g x) \sqrt {c x^2+b x+a}}dx}{e (e f-d g)}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\int \frac {c d f-b e f+a e g-c (e f-d g) x}{(f+g x) \sqrt {c x^2+b x+a}}dx}{e (e f-d g)}\)

\(\Big \downarrow \) 1269

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\frac {e \left (a g^2-b f g+c f^2\right ) \int \frac {1}{(f+g x) \sqrt {c x^2+b x+a}}dx}{g}-\frac {c (e f-d g) \int \frac {1}{\sqrt {c x^2+b x+a}}dx}{g}}{e (e f-d g)}\)

\(\Big \downarrow \) 1092

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\frac {e \left (a g^2-b f g+c f^2\right ) \int \frac {1}{(f+g x) \sqrt {c x^2+b x+a}}dx}{g}-\frac {2 c (e f-d g) \int \frac {1}{4 c-\frac {(b+2 c x)^2}{c x^2+b x+a}}d\frac {b+2 c x}{\sqrt {c x^2+b x+a}}}{g}}{e (e f-d g)}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\frac {e \left (a g^2-b f g+c f^2\right ) \int \frac {1}{(f+g x) \sqrt {c x^2+b x+a}}dx}{g}-\frac {\sqrt {c} (e f-d g) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{g}}{e (e f-d g)}\)

\(\Big \downarrow \) 1154

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {-\frac {2 e \left (a g^2-b f g+c f^2\right ) \int \frac {1}{4 \left (c f^2-b g f+a g^2\right )-\frac {(b f-2 a g+(2 c f-b g) x)^2}{c x^2+b x+a}}d\left (-\frac {b f-2 a g+(2 c f-b g) x}{\sqrt {c x^2+b x+a}}\right )}{g}-\frac {\sqrt {c} (e f-d g) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{g}}{e (e f-d g)}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\sqrt {a e^2-b d e+c d^2} \text {arctanh}\left (\frac {-2 a e+x (2 c d-b e)+b d}{2 \sqrt {a+b x+c x^2} \sqrt {a e^2-b d e+c d^2}}\right )}{e (e f-d g)}-\frac {\frac {e \sqrt {a g^2-b f g+c f^2} \text {arctanh}\left (\frac {-2 a g+x (2 c f-b g)+b f}{2 \sqrt {a+b x+c x^2} \sqrt {a g^2-b f g+c f^2}}\right )}{g}-\frac {\sqrt {c} (e f-d g) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{g}}{e (e f-d g)}\)

input
Int[Sqrt[a + b*x + c*x^2]/((d + e*x)*(f + g*x)),x]
 
output
(Sqrt[c*d^2 - b*d*e + a*e^2]*ArcTanh[(b*d - 2*a*e + (2*c*d - b*e)*x)/(2*Sq 
rt[c*d^2 - b*d*e + a*e^2]*Sqrt[a + b*x + c*x^2])])/(e*(e*f - d*g)) - (-((S 
qrt[c]*(e*f - d*g)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])]) 
/g) + (e*Sqrt[c*f^2 - b*f*g + a*g^2]*ArcTanh[(b*f - 2*a*g + (2*c*f - b*g)* 
x)/(2*Sqrt[c*f^2 - b*f*g + a*g^2]*Sqrt[a + b*x + c*x^2])])/g)/(e*(e*f - d* 
g))
 

3.9.58.3.1 Defintions of rubi rules used

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 1154
Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Sym 
bol] :> Simp[-2   Subst[Int[1/(4*c*d^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, ( 
2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c 
, d, e}, x]
 

rule 1269
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g/e   Int[(d + e*x)^(m + 1)*(a + b*x + 
 c*x^2)^p, x], x] + Simp[(e*f - d*g)/e   Int[(d + e*x)^m*(a + b*x + c*x^2)^ 
p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] &&  !IGtQ[m, 0]
 

rule 1270
Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)/(((d_.) + (e_.)*(x_))*((f_.) + 
 (g_.)*(x_))), x_Symbol] :> Simp[(c*d^2 - b*d*e + a*e^2)/(e*(e*f - d*g)) 
Int[(a + b*x + c*x^2)^(p - 1)/(d + e*x), x], x] - Simp[1/(e*(e*f - d*g)) 
Int[Simp[c*d*f - b*e*f + a*e*g - c*(e*f - d*g)*x, x]*((a + b*x + c*x^2)^(p 
- 1)/(f + g*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && FractionQ[p] 
&& GtQ[p, 0]
 
3.9.58.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(672\) vs. \(2(204)=408\).

Time = 0.76 (sec) , antiderivative size = 673, normalized size of antiderivative = 2.95

method result size
default \(\frac {\sqrt {\left (x +\frac {f}{g}\right )^{2} c +\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}+\frac {\left (b g -2 c f \right ) \ln \left (\frac {\frac {b g -2 c f}{2 g}+c \left (x +\frac {f}{g}\right )}{\sqrt {c}}+\sqrt {\left (x +\frac {f}{g}\right )^{2} c +\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}\right )}{2 g \sqrt {c}}-\frac {\left (a \,g^{2}-b f g +c \,f^{2}\right ) \ln \left (\frac {\frac {2 a \,g^{2}-2 b f g +2 c \,f^{2}}{g^{2}}+\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+2 \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}\, \sqrt {\left (x +\frac {f}{g}\right )^{2} c +\frac {\left (b g -2 c f \right ) \left (x +\frac {f}{g}\right )}{g}+\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}{x +\frac {f}{g}}\right )}{g^{2} \sqrt {\frac {a \,g^{2}-b f g +c \,f^{2}}{g^{2}}}}}{d g -e f}-\frac {\sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {e^{2} a -b d e +c \,d^{2}}{e^{2}}}+\frac {\left (b e -2 c d \right ) \ln \left (\frac {\frac {b e -2 c d}{2 e}+c \left (x +\frac {d}{e}\right )}{\sqrt {c}}+\sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {e^{2} a -b d e +c \,d^{2}}{e^{2}}}\right )}{2 e \sqrt {c}}-\frac {\left (e^{2} a -b d e +c \,d^{2}\right ) \ln \left (\frac {\frac {2 e^{2} a -2 b d e +2 c \,d^{2}}{e^{2}}+\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+2 \sqrt {\frac {e^{2} a -b d e +c \,d^{2}}{e^{2}}}\, \sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {e^{2} a -b d e +c \,d^{2}}{e^{2}}}}{x +\frac {d}{e}}\right )}{e^{2} \sqrt {\frac {e^{2} a -b d e +c \,d^{2}}{e^{2}}}}}{d g -e f}\) \(673\)

input
int((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x,method=_RETURNVERBOSE)
 
output
1/(d*g-e*f)*(((x+f/g)^2*c+(b*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^( 
1/2)+1/2*(b*g-2*c*f)/g*ln((1/2*(b*g-2*c*f)/g+c*(x+f/g))/c^(1/2)+((x+f/g)^2 
*c+(b*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^(1/2))/c^(1/2)-(a*g^2-b* 
f*g+c*f^2)/g^2/((a*g^2-b*f*g+c*f^2)/g^2)^(1/2)*ln((2*(a*g^2-b*f*g+c*f^2)/g 
^2+(b*g-2*c*f)/g*(x+f/g)+2*((a*g^2-b*f*g+c*f^2)/g^2)^(1/2)*((x+f/g)^2*c+(b 
*g-2*c*f)/g*(x+f/g)+(a*g^2-b*f*g+c*f^2)/g^2)^(1/2))/(x+f/g)))-1/(d*g-e*f)* 
(((x+d/e)^2*c+(b*e-2*c*d)/e*(x+d/e)+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2)+1/2*(b* 
e-2*c*d)/e*ln((1/2*(b*e-2*c*d)/e+c*(x+d/e))/c^(1/2)+((x+d/e)^2*c+(b*e-2*c* 
d)/e*(x+d/e)+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2))/c^(1/2)-(a*e^2-b*d*e+c*d^2)/e 
^2/((a*e^2-b*d*e+c*d^2)/e^2)^(1/2)*ln((2*(a*e^2-b*d*e+c*d^2)/e^2+(b*e-2*c* 
d)/e*(x+d/e)+2*((a*e^2-b*d*e+c*d^2)/e^2)^(1/2)*((x+d/e)^2*c+(b*e-2*c*d)/e* 
(x+d/e)+(a*e^2-b*d*e+c*d^2)/e^2)^(1/2))/(x+d/e)))
 
3.9.58.5 Fricas [F(-1)]

Timed out. \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\text {Timed out} \]

input
integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="fricas")
 
output
Timed out
 
3.9.58.6 Sympy [F]

\[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\int \frac {\sqrt {a + b x + c x^{2}}}{\left (d + e x\right ) \left (f + g x\right )}\, dx \]

input
integrate((c*x**2+b*x+a)**(1/2)/(e*x+d)/(g*x+f),x)
 
output
Integral(sqrt(a + b*x + c*x**2)/((d + e*x)*(f + g*x)), x)
 
3.9.58.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\text {Exception raised: ValueError} \]

input
integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(d*g-e*f>0)', see `assume?` for m 
ore detail
 
3.9.58.8 Giac [F(-2)]

Exception generated. \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\text {Exception raised: TypeError} \]

input
integrate((c*x^2+b*x+a)^(1/2)/(e*x+d)/(g*x+f),x, algorithm="giac")
 
output
Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 
3.9.58.9 Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {a+b x+c x^2}}{(d+e x) (f+g x)} \, dx=\int \frac {\sqrt {c\,x^2+b\,x+a}}{\left (f+g\,x\right )\,\left (d+e\,x\right )} \,d x \]

input
int((a + b*x + c*x^2)^(1/2)/((f + g*x)*(d + e*x)),x)
 
output
int((a + b*x + c*x^2)^(1/2)/((f + g*x)*(d + e*x)), x)